package cn.com.sp.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import cn.com.sp.demo.mq.Comsumer;

@Component//被spring容器管理
@Order(1)
public class MqRunner implements ApplicationRunner{

	@Value("${test.topic}")
	private String topic;
	
	@Value("${test.queue}")
	private String queue;
	
	@Autowired
	private Comsumer comsumer;
	
	private static Logger LOG = LoggerFactory.getLogger(MqRunner.class);
	
	@Override
	public void run(ApplicationArguments args) throws Exception {
		LOG.info("--------------start MqRunner");
/*		new Thread(
		new Runnable() {
			@Override
			public void run() {
				comsumer.init();
				comsumer.getMessage(queue);
			}
		}).start();*/

	}

}
